home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / mnp_c.zip / LLVL.H < prev    next >
C/C++ Source or Header  |  1990-05-16  |  4KB  |  114 lines

  1. /*******************************************************************
  2.  
  3.             LLVL.H Header File for LLVL.C
  4.  
  5.     10/29/87 - explicit data typing..gp
  6.  
  7. *******************************************************************/
  8.  
  9. #define STRM_WNDW_SZ    8    /* window size in stream mode */
  10. #define STRM_DATA_SZ   64    /* max data size in stream mode */
  11.                 /* 62 bytes of data */
  12.                 /* 2 bytes reserved */
  13. #define STRM_FDAT_SZ   62
  14.  
  15. #define LCL_SCLASS    2    /* local service class: async, full-duplex, BSC-like framing */
  16.  
  17. /* all timers have value of 1 greater than the MNP specs */
  18. /* this is to be sure they are never less than what the specs say */
  19.  
  20. #define LTTMR_24    5    /* lt retran timer for 2400 baud */
  21. #define W_TMR_24    4    /* window timer for 2400 baud */
  22.  
  23. #define LTTMR_12    7    /* lt retran timer for 1200 baud */
  24. #define W_TMR_12    8    /* window timer for 1200 baud */
  25.  
  26. #define LTTMR_3     22    /* lt retran timer for 300 baud */
  27. #define W_TMR_3     32    /* window timer for 300 baud */
  28.  
  29. #define LTTMR_110    58    /* lt retran timer for 110 baud */
  30. #define W_TMR_110    87    /* window timer for 300 baud */
  31.  
  32. #define LR_TMR        10    /* value for LR retran timer */
  33.  
  34. #define LR_TRAN_CNT    2    /* number of times to transmit an LR */
  35. #define LR_RETRAN_CNT    (LR_TRAN_CNT - 1)    /* number of times to REtransmit an LR */
  36. #define LA_WAIT_CNT    2    /* number of times to wait for an LA */
  37. #define RET_LIMIT    12    /* limit in retransmitting an LT */
  38.  
  39.  
  40. /* LR parameters bit definition ((mnpcb->lcb)->lr_parm) */
  41. #define LR_SRV_CLASS    1    /* lr received contains service class */
  42. #define LR_WNDW_SZ    2    /* lr received contains window size */
  43. #define LR_DATA_SZ    4    /* lr received contains max data size */
  44. #define LR_DATA_OPT 8    /* LR received contains data phase opt parm */
  45.  
  46. #define LR_ILEN     20    /* length of an initiator's LR */
  47. #define LR_ALEN     10    /* basic length of an acceptor's LR - no parms 2, 3 & 4 yet */
  48. #define LD_LEN        4
  49. #define LA_LEN        7
  50. #define LN_LEN        7
  51. #define LNA_LEN     4
  52. #define LTH_LEN     4
  53.  
  54. /* Link state variables */
  55. #define IDLE            0
  56. #define LR_RESP_WAIT        1
  57. #define PARMS_NEGO        2
  58. #define LR_WAIT         3
  59. #define CONNECT_REQ_WAIT    4
  60. #define LA_WAIT         5
  61. #define LNK_CONNECTED        6
  62. #define LNK_ERROR        7
  63.  
  64. #define PROTOCOL_ERR        1
  65. #define PROT_LVL_MISMATCH    2
  66. #define BAD_LR_PARMS        3
  67. #define RETRAN_TMR_EXP        4
  68. #define INACT_TMR_EXP        5
  69.  
  70. #define L_ACCEPTOR        mode
  71. #define SETBIT1(bit)        lcb.status_1 |= bit;        /* used to set bit */
  72. #define SETBIT2(bit)        lcb.status_2 |= bit;
  73. #define SETBIT3(bit)        lcb.status_3 |= bit;
  74. #define CLRBIT1(bit)        lcb.status_1 &= ~(bit);     /* used to clear bit */
  75. #define CLRBIT2(bit)        lcb.status_2 &= ~(bit);
  76. #define CLRBIT3(bit)        lcb.status_3 &= ~(bit);
  77. #define BIT1SET(bit)        (lcb.status_1 & bit)        /* used to test if bit is set */
  78. #define BIT2SET(bit)        (lcb.status_2 & bit)
  79. #define BIT3SET(bit)        (lcb.status_3 & bit)
  80.  
  81. #define WAIT        1
  82. #define NOWAIT        0
  83. #define B_2400        5        /* code for 2400 baud */
  84. #define B_1200        4        /* code for 1200 baud */
  85. #define B_300        2        /* code for 300 baud */
  86. #define B_110        1        /* code for 110 baud */
  87. #define RF_INIT     0
  88. #define SF_INIT     0
  89. #define MAX_LPDU_SZ    100
  90. #define BLK_DATA_SZ 260
  91.  
  92. /* send framer variables */
  93. extern USIGN_16 frame_snt,
  94.             frame_dne;
  95. extern USIGN_16 sf_busy,            /* set by send_pdu, cleared by send framer */
  96.              sf_lt,
  97.             sf_len,         /* cleared by send_pdu, if sending LD */
  98.             sf_state;        /* initialized by link_reset */
  99. extern USIGN_16 modem_out_busy;
  100. extern void trigger_sf();
  101. extern USIGN_8 *sf_ptr;
  102.  
  103. /* receive framer variable */
  104. extern USIGN_16 frame_rcvd;
  105. extern USIGN_16 rf_busy,            /* set and cleared by rcv_framer */
  106.             rf_bupdate,
  107.                rf_state, 
  108.             rdle_flg;
  109. extern struct BUFFER *p_rb, 
  110.                 *p_ftb,
  111.                 *p_rlkb;
  112. extern USIGN_16 baudrate;
  113. extern struct MNP_CB *p_mnpcb;
  114.